<!DOCTYPE html>
<html>
	<head>
		<!--
        	作者：刘开新
        	时间：2018-09-29
        	描述：
        -->
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../css/font-awesome-4.7.0/css/font-awesome.css" />
	</head>
	<body>
		<div>
			<h1><i id="dianzan" class="fa fa-hand-o-left" aria-hidden="true" onclick="dianzan(this)" >点赞</i></h1>
		</div>
		
		<script type="text/javascript">
			var a=0;
			function dianzan(obj){
			var dian=document.getElementById("dianzan")
			if(a==0){
				console.log(a);
				dian.innerText="取消点赞";
				dian.style.color="red";
				a=1;
			}else{
				console.log(a);
				dian.innerText="点赞";
				dian.style.color="black";
				a=0;
			}
			
		}
		</script>
	</body>
</html>
